package com.generator.dao.article;

import com.generator.dto.article.ArticleAuditDto;
import com.generator.dto.article.ArticleDto;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.springframework.stereotype.Component;

import java.util.List;

@Mapper
@Component(value = "ArticleDao")
public interface ArticleDao {

    void addArticle(@Param("articleDto")ArticleDto articleDto);

    void delArticle(@Param("articleId")int articleId);

    void updateArticle(@Param("articleDto")ArticleDto articleDto);

    List<ArticleDto> findAllArticle();

    ArticleDto findArticleById(@Param("articleId")int articleId);


    List<ArticleAuditDto> auditOpinions();

    void updateOpinion(@Param("articleAuditDto")ArticleAuditDto articleAuditDto);

    ArticleAuditDto findOpinionById(@Param("articleId")Integer articleId);
}
